
/*
 * @项目名称: 模板开发
 * @FilePath: /meek/src/utils/canvas.js
 * @Author: 1106408264@qq.com
 * @Date: 2017-06-07T14:17:46+08:00
 * @LastEditors: 593949622@qq.com
 * @LastEditTime: 2017-07-07T15:20:08+08:00
 * Copyright (c) 2018-2022
 */

/**
 * Created by zhangyong on 2017/6/7.
 */


export const Canvas = {}


/**
 *
 * @param context
 * @param rotation
 * @param offsetX
 * @param offsetY
 */
Canvas.rotateAtOffset = function(context, rotation, offsetX, offsetY) {
  if (rotation !== 0) {
    context.translate(offsetX, offsetY)
    context.rotate(rotation)
    context.translate(-offsetX, -offsetY)
  }
}



export default {
  Canvas
}
